
module.exports = {
    // 查询用户
    userList: `SELECT * FROM user WHERE user_phone LIKE ? AND user_name LIKE ? AND user_status = 1 LIMIT 10 OFFSET ?`,
    // 查询总数
    totalCount: `SELECT COUNT(*) AS total FROM user WHERE user_phone LIKE ? AND user_name LIKE ? AND user_status = 1`,
    // 根据Token获取用户信息
    userInfo: 'SELECT * FROM user WHERE user_name = ? AND user_status = 1 LIMIT 1',
    // 新增用户
    addUser: `INSERT INTO user(user_name,user_password,user_phone,user_role) VALUES(?,?,?,?)`,
    // 编辑用户
    editUser: `UPDATE user SET user_name = ?, user_phone = ?, user_role = ? WHERE user_id = ?`,
    // 删除用户
    deleteUser: `UPDATE user SET user_status = 2 WHERE user_id = ?`,
    // 查询用户是否存在
    findExists: `SELECT * FROM user WHERE (user_name = ? OR user_phone = ?) AND user_status = 1`,
    // 更改密码
    changePassword: `UPDATE user SET user_password = ? WHERE user_id = ?`,
}
